#ifndef DRAGWIDGET_H
#define DRAGWIDGET_H

#include <QWidget>
#include <QFrame>

class QDragEnterEvent;
class QDropEvent;

class DragWidget : public QFrame
{
public:
    DragWidget(QWidget *parent = 0);

signals:

public slots:

protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dragMoveEvent(QDragMoveEvent *event);
    void dropEvent(QDropEvent *event);
    void mousePressEvent(QMouseEvent *event);
     void paintEvent(QPaintEvent *event);

    private:
     const QRect targetSquare(const QPoint &position) const;
    int findPiece(const QRect &pieceRect) const;
    QList<QPixmap> piecePixmaps;
         QList<QRect> pieceRects;
         QList<QPoint> pieceLocations;
          QRect highlightedRect;
};

#endif // DRAGWIDGET_H
